<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddResponseCodeToCollectionApiRequests extends Migration
{
    protected $table = "collection_api_requests";
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //$table->integer('response_code')->index()->default(0)->comment('响应催收的状态码');
        Schema::table($this->table, function (Blueprint $table) {
            $table->integer('response_code')->index()->default(0)->comment('响应催收的状态码');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        if(Schema::hasTable($this->table)){
            Schema::table($this->table, function (Blueprint $table) {
                $table->dropColumn('response_code');
            });
        }
    }
}
